import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'

import Layout from '../components/layout/Index.vue'
import simulate from '@/assets/images/simulate.png'
import task from '@/assets/images/task.png'
import setting from '@/assets/images/setting.png'
import group from '@/assets/images/group.png'
import divide from '@/assets/images/divide.png'


const subRouter = [
  {
    name: '任务中心',
    path: '/task',
    icon: task,
    component: () => import('../views/TaskCenter.vue'),
  },
  {
    name: '网格划分',
    path: '/mesh',
    icon: divide,
    component: () => import('../views/MeshGeneration.vue'),
  },
  //MeshGeneration
  {
    name: '仿真中心',
    path: '/simulate',
    icon: simulate,
    component: () => import('../views/SimulateCenter.vue'),
  },
  {
    name: '分组设置',
    path: '/groupSetting',
    icon: group,
    component: () => import('../views/GroupSetting.vue'),
  },
  {
    name: '参数设置',
    path: '/setting',
    icon: setting,
    component: () => import('../views/ParameterSetting.vue'),
  }

]



const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'redirect',
      redirect: '/task',
      component: Layout,
      meta: { isBgWhite: true },
      children: subRouter
    },

    {
      name: '模型展示',
      path: '/modelView',
      icon: simulate,
      component: () => import('../views/ModelView.vue'),
    }
  ]
})

export { subRouter,router }

